//
// Created by Fionera on 2018/6/21.
//

#include "WsdkCore.h"

JNIEXPORT jboolean JNICALL
Java_com_wsdk_util_JniCoreBridge_fetchLogController(JNIEnv *env, jclass type) {
    // TODO: Disable Log Feature
    return JNI_FALSE;
}

JNIEXPORT jstring JNICALL
Java_com_wsdk_util_JniCoreBridge_fetchServerDefaultKey(JNIEnv *env, jclass type) {
    LOGE("Access Default Key");
    return (*env)->NewStringUTF(env, "ddd");
}

JNIEXPORT jbyteArray JNICALL
Java_com_wsdk_util_JniCoreBridge_fetchEncryptKey(JNIEnv *env, jclass type) {
    /*private static final byte[] KEY = {(byte) 0xB4, 0x31, 0x5B, (byte) 0x86, (byte) 0x9D, 0x7D,
            (byte) 0xFA, (byte) 0xA2};*/
    int keyArrayLen = 8;
    jbyte* keyArray = (*env)->NewByteArray(env, 8);

    jbyte a[8] = {(jbyte) 0xB4, 0x31, 0x5B, (jbyte) 0x86, (jbyte) 0x9D, 0x7D,
                  (jbyte) 0xFA, (jbyte) 0xA2};
    (*env)->SetByteArrayRegion(env, keyArray, 0, keyArrayLen, a);
    return keyArray;
}
